<template>
    <ul class="nav-bar">
        <li>
            <!-- <a href="#/default">欢迎页</a> -->
            <RouterLink to="/default">欢迎页</RouterLink>
        </li>
        <li>
            <span>环境讲解</span>
            <ul class="child-menu">
                <li>
                    <RouterLink to="/error">欢迎页模块化错误和静态资源</RouterLink>
                </li>
                <li>
                    <RouterLink to="/style">欢迎页单位件样式</RouterLink>
                </li>
                <li>
                    <RouterLink to="/build">欢迎页模块项目打包</RouterLink>
                </li>
            </ul>
        </li>
        <li>
            <span>Vue组合式</span>
            <ul class="child-menu">
                <li>
                    <RouterLink to="/compos1">组合式Api</RouterLink>
                </li>
                <li>
                    <RouterLink to="/compos2">组合式Api语法1</RouterLink>
                </li>
                <li>
                    <RouterLink to="/compos3">组合式Api语法2</RouterLink>
                </li>
                <li>
                    <RouterLink to="/cart">购物车</RouterLink>
                </li>
            </ul>
        </li>
        <li>
            <span>异步请求</span>
            <ul class="child-menu">
                <li>
                    <RouterLink to="/ajax">axios的安装和基本使用</RouterLink>
                </li>
            </ul>
        </li>
    </ul>
    <div class="box">
        <RouterView></RouterView>
    </div>
</template>

<script>
export default {

}
</script>

<style scoped>
.nav-bar {
    /* 粘性定位 */
    position: sticky;
    top: 0px;
    left: 0px;
    height: 60px;
    line-height: 60px;
    display: flex;
    list-style: none;
    padding: 0px;
    margin: 0px;
    background-color: #333;
    box-shadow: 0 0 8px #666;
    padding: 0px 10px;
    z-index: 999;
}

.nav-bar>li {
    color: white;
    height: 100%;
    padding: 0px 10px;
    cursor: pointer;
    position: relative;
}

.nav-bar>li>span::after {
    font-family: "iconfont" !important;
    font-size: 18px;
    content: "\e620";
}

.nav-bar>li:hover {
    background-color: #932d08;
}

.nav-bar>li:hover .child-menu {
    display: block;
}

.nav-bar .child-menu {
    position: absolute;
    top: 60px;
    left: 0px;
    background-color: #555;
    list-style: none;
    padding: 0px;
    margin: 0px;
    box-shadow: 0 0 8px #888;
    display: none;
}

.nav-bar .child-menu>li {
    width: 220px;
    padding: 6px 16px;
    line-height: 2;
}

.nav-bar .child-menu>li:hover {
    background-color: #932d08;
}

.box {
    padding: 20px;
}
</style>